package com.itcheetah.springevent.observer.impl;

import com.itcheetah.springevent.observer.inter.Observer;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import java.util.Objects;

/**
 * @className: ThunderGodObserver
 * @description: 雷公电母观察者类
 * @author: cheetah
 * @date: 2021/11/30 11:23
 * @Version: 1.0
 */
@Component
public class ThunderGodObserver implements Observer {

    @Override
    public void update(String goldenCudgel) {
        if(upGoldenCudgel(goldenCudgel)){
            System.out.println("雷公电母发出电闪雷鸣");
        }
    }

    public boolean upGoldenCudgel(String goldenCudgel){
        if(Objects.equals(goldenCudgel,"up")){
            return true;
        }
        return false;
    }
}
